package com.usian.behavior.controller;

import com.usian.apis.behavior.ApLikesBehaviorControllerApi;
import com.usian.behavior.service.ApLikeBeaviorService;
import com.usian.model.behavior.dtos.LikesBehaviorDto;
import com.usian.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/likes_behavior")
public class ApLikesBehaviorController implements ApLikesBehaviorControllerApi {

    @Autowired
    private ApLikeBeaviorService apLikeBeaviorService;


    /**
     * 用户行为保存点赞行为
     *
     * @param dto
     * @return
     */
    @Override
    @PostMapping("/like")
    public ResponseResult like(@RequestBody LikesBehaviorDto dto) {
        return apLikeBeaviorService.saveLikeBeavior(dto);
    }
}
